#include <winsock2.h>
#include <ws2tcpip.h>

namespace SV_USAGERULES_SPOOFING {
	namespace bad {
		void foo()
		{
			struct hostent* he;
			struct in_addr ipv4addr = { 0 };

			inet_pton(AF_INET, "127.0.0.1", &ipv4addr);
			he = gethostbyaddr((char*)&ipv4addr, sizeof ipv4addr, AF_INET);
		}
	}

	namespace good {
		void foo()
		{
			struct sockaddr_in sa;
			char host[NI_MAXHOST] = "127.0.0.1";
			char service[NI_MAXSERV];

			getnameinfo((struct sockaddr*)&sa, sizeof sa, host, sizeof host, service, sizeof service, NI_NUMERICSERV);
		}
	}
}